import logging, yagmail, time



def log():
    t = time.strftime('%Y%m%d%H%M%S', time.localtime())
    tt = 'zk' + t + '.log'
    logging.basicConfig(filename='log.log',
                        filemode='w+',
                        format='%(levelname)s -> %(filename)s ->%(asctime)s -> %(message)s',
                        level=logging.DEBUG
                        )
    return tt


def fasong(aa):
    r = yagmail.SMTP(user="2796502172@qq.com", password='gzxbqpmttpesdcig', host='smtp.qq.com')
    r.send(to='2796502172@qq.com', subject='测试附件', contents='请查收', attachments=aa)



